<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

</body>
<script>
  // sort  forEach map filter some  every reduce

  // var list = [2,8,4,6,5,7,9,3,1]
  // list.reduce(function(prev,item,index,array){
  //     console.log(prev,item,index,array);
  //     return prev + item;
  // },0)

  // 数组和对象

  var zhangSan = {
    "name": "张三",
    chinese: 55,
    math: 66,
    english: 77
  }

  console.log(zhangSan.name);
  console.log(zhangSan["chinese"]);

  zhangSan.name = "李四"
  zhangSan["chinese"] = 85;
  console.log(zhangSan);


  for (var key in zhangSan) {
    console.log(key, typeof key, zhangSan[key]);
  }


  // 判断一个数组是否是数组?

  console.log([] instanceof Array);
  console.log({} instanceof Object);

  console.log(Array.isArray([]));
  console.log(Array.isArray({}));

  // var list = [1,2,[3,4,[3,4,[5,6]]]]

  // [0][0]   => 0

  // var arr = [0];
  // arr[0];




</script>

</html>